package com.xinruke.hostels.central.manage.controller;

import com.xinruke.hostels.central.manage.interfaces.dto.sensitiveword.SensitiveWordCheckDTO;
import com.xinruke.hostels.central.manage.interfaces.dto.sensitiveword.SensitiveWordCheckResultDTO;
import com.xinruke.hostels.central.manage.service.SensitiveWordService;
import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author yutaipu
 */
@RestController
@RequestMapping(value = "/sensitive-word/api")
@Api(tags = "敏感词Api接口")
@Slf4j
public class SensitiveWordInnerAPIController extends BaseController {

    @Autowired
    private SensitiveWordService sensitiveWordService;

    @PostMapping(value = "/check")
    @ApiOperation(value = "校验")
    public ResultVO<SensitiveWordCheckResultDTO> check(@Valid @RequestBody SensitiveWordCheckDTO params){
        return sensitiveWordService.check(params);
    }
}
